from time import sleep
from selenium.webdriver.common.by import By
from lagou_cekai.task3_1.thirteen_class_actual_combat.Page.Base_page import BasePage




class ContactPage(BasePage):
    # 封装的元素
    ele_addmember = (By.CSS_SELECTOR, ".ww_operationBar>a:nth-of-type(1)")
    ele_menberlist =(By.CSS_SELECTOR,".member_colRight_memberTable_td:nth-child(2)")
    _url = "https: // work.weixin.qq.com / wework_admin / frame  # contacts"
    def contact_add_member(self):
        '''
        通讯录页面点击添加成员
        :return:
        '''
        from lagou_cekai.task3_1.thirteen_class_actual_combat.Page.add_member import AddMemberPage
        sleep(2)
        self.driver.find_element(*self.ele_addmember).click()
        return AddMemberPage(self.driver)
    def contact_gain_member_list(self):
        '''
        通讯录页面获取成员列表
        这里return的估计就是断言了
        :return:
        '''
        sleep(2)
        list = self.driver.find_elements(*self.ele_menberlist)
        print(list)
        title_result=[i.text for i in list]
        print(title_result)
        return title_result